import React, { useState, useEffect } from "react";
import { Card } from "antd";
import { useRequest } from "ahooks";
import { getFetch } from "@/utils/doFetch";

function Type() {
  const { data, loading } = useRequest(async () => {
    let res = await getFetch({ url: "/device/device_types", params: {} });
    return res?.data?.dataList;
  });

  console.log(data);

  return (
    <div style={{ padding: 12 }}>
      <b style={{ fontSize: 16, display: "block", marginBottom: 24,paddingLeft:24 }}>
        设备类型
      </b>
      {data?.map?.((it) => {
        return <Card style={{marginBottom:12}} hoverable>{it?.name}</Card>;
      })}
    </div>
  );
}

export default Type;
